package com.fay.designPattern.reflector;

import com.fay.designPattern.principles.metrics.UserVo;

import java.util.Collections;
import java.util.List;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/4/1 21:57
 * @Version 1.0
 */
public class NullObjectDesignPattern {
    public static void main(String[] args) {
        List<UserVo> xxx = getUsers("xxx");
        // 不用判空，空集合
        for (UserVo userVo : xxx) {
            System.out.println(userVo);
        }

        String eang = retrieveUppercaseLetters("eang");
        int length = eang.length();//不用先判空
        System.out.println("contains" + length + "upper case letters");
    }

    public static List<UserVo> getUsers(String telephone) {
        // not found
        return Collections.emptyList();
    }

    public static String retrieveUppercaseLetters(String text) {
        // if no uppercase letters in text, return blank instead of null
        return "";
    }
}
